export interface OperateLogDO {
  id: number;
  traceId: string;
  userId: number;
  userType: number;
  type: string;
  subType: string;
  bizId: number;
  action: string;
  extra: string;
  requestMethod: string;
  requestUrl: string;
  userIp: string;
  userAgent: string;
  createTime: number ;
}

export interface OperateLogQueryParams {
  type?: string;
  subType?: string;
  userId?: number;
  action?: string;
  createTime?: [string, string];
  current?: number;
  pageSize?: number;
}

export enum UserTypeEnum {
  ADMIN = 1,
  MEMBER = 2,
  GUEST = 3
}

export const UserTypeMap = {
  [UserTypeEnum.ADMIN]: '管理员',
  [UserTypeEnum.MEMBER]: '普通用户',
  [UserTypeEnum.GUEST]: '访客'
};

export const RequestMethodColor = {
  GET: 'green',
  POST: 'blue',
  PUT: 'orange',
  DELETE: 'red',
  PATCH: 'purple',
  DEFAULT: 'gray'
};

export interface ApiLogRespVO {
  olId: number;
  orderCode: string;
  referenceNo: string;
  statusCode: string;
  requestUrl: string;
  method: string;
  requestHeaders: string;
  requestBody: string;
  responseBody: string;
  errorMsg: string;
  requestTime: number; // 通常是ISO格式的时间字符串
  responseTime: number; // 通常是ISO格式的时间字符串
  costTime: number;
  createTime: string; // 通常是ISO格式的时间字符串
}

export interface OrderLogRespVO {
  olId: number;
  opType: string;
  orderId: number;
  orderCode: string;
  olType: number;
  orderStatusFrom: string;
  orderStatusTo: string;
  userId: number;
  userName: string;
  olIp: string;
  olComments: string;
  createTime: number;
}
